select a.matricule,libressource1,libressource2,datpla,plage,a.typjrs,a.hrsdeb,a.hrsfin,a.codposte,libposte,b.col01 
FROM postpla a, poste b, rcressource c 
where a.matricule=c.matricule and a.codposte=b.codposte and col01 = 'ADS-RMPV' 
and libposte = 'RESPONSABLE SITE' and a.matricule not in (select distinct (matricule) from tbabsenc abs WHERE abs.datdeb <= to_date('2013-04-06', 'YYYY-MM-DD') and abs.datfin >= to_date('2013-04-06','YYYY-MM-DD'));


select * from gtactjou jr ;

select * from gtjour jr
where date_ >= '01/03/2013' and date_ <= '31/03/2013'
and matricule = '02599';

select libressource1, libressource2, re.matricule, count(re.matricule) as nbjr 
from gtjour jr
inner join rcressource re
on jr.matricule = re.matricule
where date_ >='01/03/2013' and date_ <= '31/03/2013'
and hr_effec <> 0
and hr_rect <> 0
and hr_trav <> 0
group by re.matricule, libressource1, libressource2
order by libressource1;

select libressource1, libressource2, re.matricule, count(re.matricule) as nbjr 
from gtactjou jr 
inner join rcressource re
on jr.matricule = re.matricule
where date_ > '01/03/2013' and date_ < '31/03/2013' 
group by re.matricule, libressource1, libressource2
order by libressource1;

select matricule, to_char(date_, 'MM') as mois, count(matricule) from gtcpthis 
where date_ >= '01/12/2013' and date_ <= '30/11/2014'
and codcpt = '203'
group by to_char(date_, 'MM'), matricule
order by matricule, mois 
;

select matricule, to_char(date_, 'MM') as mois, count(matricule) from gtcpthis 
where date_ >= '01/12/2012' and date_ <= '30/11/2013'
and codcpt = '201'
group by to_char(date_, 'MM'), matricule
order by matricule, mois 
;

         